package top.moonkit.rs_pro;

import com.mybatisflex.core.audit.AuditManager;
import com.mybatisflex.core.audit.ConsoleMessageCollector;
import com.mybatisflex.core.audit.MessageCollector;
import com.mybatisflex.core.keygen.KeyGeneratorFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import top.moonkit.rs_pro.config.SnowKeyGenerator;

@SpringBootApplication
@MapperScan("top.moonkit.rs_pro.mapper")
public class RsProApplication {

    public static void main(String[] args) {

        //开启审计功能
        AuditManager.setAuditEnable(true);

        //设置 SQL 审计收集器
        MessageCollector collector = new ConsoleMessageCollector();
        AuditManager.setMessageCollector(collector);
        KeyGeneratorFactory.register("snowKey", new SnowKeyGenerator());

        SpringApplication.run(RsProApplication.class, args);
    }

}
